<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/taglib.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>普田学院学籍管理系统</title>
<link rel="stylesheet" media="screen,projection" type="text/css"
	href="css/reset.css" />
<link rel="stylesheet" media="screen,projection" type="text/css"
	href="css/main.css" />
<!--[if lte IE 6]><link rel="stylesheet" media="screen,projection" type="text/css" href="css/main-ie6.css" /><![endif]-->
<link rel="stylesheet" media="screen,projection" type="text/css"
	href="css/style.css" />
<link rel="stylesheet" media="screen,projection" type="text/css"
	href="css/mystyle.css" />
<link href="css/grid/grid.css" type="text/css" rel="stylesheet"
	media="screen" />
<link href="css/calendar.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/textbox.js"></script>
 
<script type="text/javascript" src="js/aa.js"></script>
<script type="text/javascript" src="js/cal.js"></script>
<script type="text/javascript" src="js/ajax.js"></script>



</head>
<body>
<%@include file="/front/head.jsp"%>
	<html:form action="writeReceipt" method="post">
		<input type="hidden" name="callMethod" id="callMethod"	value="submitUser" />

		<html:hidden property="userVO.id" styleId="userVO.id" />
			
				<div id="menu" class="row">
					<div class="column grid_16">
						<ul class="box">
								<li id="menu-active"><a href="writeReceipt.do?callMethod=returnToList"><strong><span>当前共有&nbsp;<b class="red"><%=request.getAttribute("dataCount") %></b>&nbsp;条学生档案 </span> </strong></a></li>
						</ul>
					</div>
				</div>
			
<div id="content"  class="row ireadonly">
  <div class="column grid_16">
  
   <fieldset>
<legend>本人基本资料</legend>
 <table width="100%" border="1" cellspacing="10"  cellpadding="10" class="nostyle">
  <tr>
    <td width="9%" style="text-align:right" >姓名:</td>
    <td width="16%"><html:text property="userVO.userName" styleId="userVO.userName"	styleClass="input-text" maxlength="6"/></td>
    <td width="9%" style="text-align:right">年龄:</td>
    <td width="16%"><html:text property="userVO.age" styleId="userVO.age"		styleClass="input-text" maxlength="3"/></td>
    <td width="9%" style="text-align:right" >身份证号：</td>
    <td width="16%">
	<html:text property="userVO.sfz" styleId="userVO.sfz"	style="width:85%" maxlength="18"	styleClass="input-text" />
	</td>
    <td width="9%" style="text-align:right">性别:</td>
    <td width="16%">
	<html:select property="userVO.sex">
	<html:option value="男">男</html:option>
	<html:option value="女">女</html:option>
	</html:select>
	</td>
   
  </tr>
   <tr>
    <td width="9%" style="text-align:right">农(居)民:</td>
    <td >
	<html:select property="userVO.nm">
		<html:option value="是">是</html:option>
		<html:option value="否">否</html:option>
		</html:select>
	
	</td>
     <td width="9%" style="text-align:right" >籍贯:</td>
    <td width="16%"><html:text property="userVO.jg" styleId="userVO.jg" 	styleClass="input-text" maxlength="20"/></td>
    <td width="9%" style="text-align:right">民族:</td>
    <td width="16%"><html:text property="userVO.mz" styleId="userVO.mz"		styleClass="input-text" maxlength="6"/></td>
    <td width="9%" style="text-align:right">出生年月:</td>
    <td >
    <nested:empty property="userVO.birthday">
	<html:text property="userVO.birthday" readonly="true" style="width:40%"
								value="点击选择日期" styleClass="readonly input-text" 
								styleId="userVO.birthday" />
	</nested:empty>	
	
	<nested:notEmpty property="userVO.birthday">
	<html:text property="userVO.birthday" readonly="true" style="width:40%"
								 styleClass="readonly input-text" 
								styleId="userVO.birthday" />
	</nested:notEmpty>							
								
	</td>
  </tr>
   <tr>
     <td width="9%" style="text-align:right" >入学时间:</td>
    <td >
    <nested:empty property="userVO.rxsj">
<html:text property="userVO.rxsj" readonly="true"
								value="点击选择日期" styleClass="input-text readonly " 
								styleId="userVO.rxsj" />
								</nested:empty>
								
								<nested:notEmpty property="userVO.rxsj">
								<html:text property="userVO.rxsj" readonly="true"
								 styleClass="input-text readonly " 
								styleId="userVO.rxsj" />
								</nested:notEmpty>
								
</td>
    <td width="9%" style="text-align:right">专业:</td>
    <td width="16%">
    
    <html:select property="userVO.zy">		
		<html:option value="工程机械 ">工程机械</html:option>
<html:option value="高级烹饪">高级烹饪 </html:option>
<html:option value="汽车维修 ">汽车维修 </html:option>
<html:option value="电气焊 ">电气焊</html:option>
<html:option value="机电数控">机电数控</html:option>
<html:option value="美容美发 ">美容美发</html:option>
<html:option value="农机修理 ">农机修理</html:option>
<html:option value="音美幼师 ">音美幼师</html:option>
<html:option value="农村经济管理 ">农村经济管理</html:option>
<html:option value="农村电工与家电维修">农村电工与家电维修</html:option>
		</html:select>
		
  </td>
    <td width="9%" style="text-align:right">班级:</td>
    <td width="16%" colspan="3">
	<html:text property="userVO.bj" styleId="userVO.bj"	style="width:40%"	styleClass="input-text" maxlength="10"/>
	</td>
  </tr>
  <tr>
     <td width="9%" style="text-align:right" >户籍所在地:</td>
    <td colspan="7">
	<html:select property="userVO.hj_sheng">
	    <html:option value="陕西省">陕西省</html:option>
		<html:option value="甘肃省">甘肃省</html:option>
		<html:option value="山西省">山西省</html:option>
		<html:option value="河南省">河南省</html:option>
		<html:option value="四川省">四川省</html:option>
		<html:option value="宁夏省">宁夏省</html:option>
		<html:option value="新疆省">新疆省</html:option>
		<html:option value="内蒙">内蒙</html:option>
		</html:select>省（市）
		
		<html:text property="userVO.hj_xian" styleId="userVO.hj_xian"	style="width:15%;"	styleClass="input-text" maxlength="6"/>县（市）
		<html:text property="userVO.hj_xiang" styleId="userVO.hj_xiang"	style="width:15%;"	styleClass="input-text" maxlength="6"/>乡（镇）
		<html:text property="userVO.hj_cun" styleId="userVO.hj_cun"		style="width:15%;" styleClass="input-text" maxlength="6"/>村
		<html:text property="userVO.hj_zu" styleId="userVO.hj_zu"		style="width:15%;" styleClass="input-text" maxlength="6"/>组

	</td>
    
  </tr>
  
  
 
  

  </table>
  </fieldset>
<br />
  </div>
</div>

<aa:zone name="jlZone">
<input type="hidden"  id="jlId" name="jlId"/>	
<div id="content"  class="row ireadonly">
  <div class="column grid_16">
   <h4 class="tit">本人简历</h4><input type="button"  onclick=addJl(); class="input-submit" value="新增本人简历"/>
  <table id="jlTable"  width="100%" border="0" cellspacing="0" cellpadding="0" style="text-align: center;" class="nostyle">	 	 	 	 	 	 	 	
  <tr>
    <td width="32%">何年何月至何年何月</td>
    <td width="32%">在何校学习</td>
    <td width="32%">备注</td>
    <td width="4%">操作</td>
   
  </tr>
  <nested:iterate property="userVO.jlList" id="jlVO" indexId="jlid">
  <tr>
    <td><nested:text property="hnhy" styleClass="input-text"  styleId="hnhy" maxlength="30"/></td>
    <td><nested:text property="hx" styleClass="input-text"  styleId="hx" maxlength="30"/></td>
    <td><nested:text property="zmr" styleClass="input-text"  styleId="zmr" maxlength="30"/></td>
    <td width="8%">
    	<logic:notEqual value="0" name="jlid">
    		<input type="button"  onclick="deleteJl(<nested:write name='jlid' />)"  class="input-submit" value="删除"/>
    	</logic:notEqual>
	</td>
  </tr>
  </nested:iterate>
</table>
<br />
</div>
</div>
</aa:zone>



<aa:zone name="jtZone">
<input type="hidden"  id="jtId" name="jtId"/>				
<div id="content"  class="row">
  <div class="column grid_16">
   <h4 class="tit">家庭主要成员</h4><input type="button" onclick=addJt(); class="input-submit" value="新增家庭成员"/>
  <table  id="jtTable" width="100%" border="0" cellspacing="0" cellpadding="0" style="text-align: center;" class="nostyle">	 	 	 	 	 	 	 	
  <tr>
    <td width="16%">关系</td>
    <td width="16%">姓名</td>
    <td width="16%">年龄</td>
    <td width="16%">政治面貌</td>
    <td width="16%">职业</td>
    <td width="16%">工作单位及职务</td>
    <td width="4%">操作</td>
   
  </tr>
  <nested:iterate property="userVO.jtList" id="jtVO" indexId="jtid">
  
  <tr>
    <td><nested:text property="gx" styleClass="input-text"  styleId="gx" maxlength="30"/></td>
    <td><nested:text property="xm" styleClass="input-text"  styleId="xm" maxlength="30"/></td>
    <td><nested:text property="nl" styleClass="input-text"  styleId="nl" maxlength="30"/></td>
    <td><nested:text property="zzmm" styleClass="input-text"  styleId="zzmm" maxlength="30"/></td>
    <td><nested:text property="zy" styleClass="input-text"  styleId="zy" maxlength="30"/></td>
    <td><nested:text property="gzdw" styleClass="input-text"  styleId="gzdw" maxlength="30"/></td>
    <td width="8%">
    	<logic:notEqual value="0" name="jtid">
    		<input type="button" onclick="deleteJt(<nested:write name='jtid' />)" class="input-submit" value="删除"/>
    	</logic:notEqual>
	</td>
  </tr>
  </nested:iterate>
</table>
<br />


<br>
			
	</div>
</div>	

</aa:zone>

<div id="content"  class="row ireadonly">
<nested:hidden property="userVO.sfz_z" styleId="userVO.sfz_z"/>
<nested:hidden property="userVO.sfz_f" styleId="userVO.sfz_f"/>
<nested:hidden property="userVO.zp" styleId="userVO.zp"/>
<nested:hidden property="userVO.zw" styleId="userVO.zw"/>
  <div class="column grid_16">
   <h4 class="tit">照片和身份证预览
   
   </h4>
  <table id="jlTable"  width="100%" border="0" cellspacing="0" cellpadding="0" style="text-align: center;">
  <tr>
    <td  width="20%">照片预览<br>
    <nested:notEmpty property="userVO.zp">
   		<img id='zp_img' width="120"  height="150" src="http://localhost:8880/tx/<nested:write property="userVO.zp" />">
   </nested:notEmpty>
   <nested:empty property="userVO.zp">
   		<img id='zp_img' width="120"  height="150" src="img/pz.gif">
   
   </nested:empty>
   
   
   
   
   
   
   
    </td>
     <td  width="30%">身份证正面预览<br>
      <nested:notEmpty property="userVO.sfz_z">
   		<img id='sfz_z_img' width="210"  height="330" src="http://localhost:8880/tx/<nested:write property="userVO.sfz_z"/>">
   </nested:notEmpty>
   <nested:empty property="userVO.sfz_z">
   		 <img id='sfz_z_img' width="210"  height="330" src="img/sm.gif">
   
   </nested:empty>
   
     
  
    </td>
    
    
    
    <td width="30%">身份证反面预览<br>
    
     <nested:notEmpty property="userVO.sfz_f">
   		<img id='sfz_f_img' width="210"  height="330" src="http://localhost:8880/tx/<nested:write property="userVO.sfz_f"/>">
   </nested:notEmpty>
   <nested:empty property="userVO.sfz_f">
   		 <img id='sfz_f_img' width="210"  height="330" src="img/sm.gif">
   
   </nested:empty>
    </td>
    
    
    <td >指纹预览<br>
     <nested:notEmpty property="userVO.zw">
   		<img id='zw_img' width="100"  height="100" src="http://localhost:8880/tx/<nested:write property="userVO.zw"/>">
   </nested:notEmpty>
   <nested:empty property="userVO.zw">
   		 <img id='zw_img' width="100"  height="100" src="img/sm.gif">
   
   </nested:empty>
    
    </td>
  </tr>
  
  
  
</table>


<br />
</div>
</div>
<%-- 
<table id="jlTable"  width="100%" border="0" cellspacing="0" cellpadding="0" style="text-align: center;">	 	 	 	 	 	 	 	
  <tr>
    <td >
    <p>
  <html:hidden styleId="zp" property="userVO.zp"/>	
  <html:hidden  styleId="sfz_z" property="userVO.sfz_z"/>	
  <html:hidden  styleId="sfz_f" property="userVO.sfz_f"/>	
  <input type="button" value="上传相片"  id="btnUpload1"/> 
  <input type="button" value="上传身份证正面"  id="btnUpload2"/>
  <input type="button" value="上传身份证反面"  id="btnUpload3"/>
</p>
  <object classid="clsid:15D142CD-E529-4B01-9D62-22C9A6C00E9B" id="scaner1" width="100%" height="600" codebase="cabs/ScanOnWeb.cab#version=1,0,0,10">
    <param name="Visible" value="0">
    <param name="AutoScroll" value="0">
    <param name="AutoSize" value="0">
    <param name="AxBorderStyle" value="0">
    <param name="Caption" value="scaner">
    <param name="Color" value="4278190095">
    <param name="Font" value="宋体">
    <param name="KeyPreview" value="0">
    <param name="PixelsPerInch" value="96">
    <param name="PrintScale" value="1">
    <param name="Scaled" value="-1">
    <param name="DropTarget" value="0">
    <param name="HelpFile" value>
    <param name="PopupMode" value="0">
    <param name="ScreenSnap" value="0">
    <param name="SnapBuffer" value="10">
    <param name="DockSite" value="0">
    <param name="DoubleBuffered" value="0">
    <param name="ParentDoubleBuffered" value="0">
    <param name="UseDockManager" value="0">
    <param name="Enabled" value="-1">
    <param name="AlignWithMargins" value="0">
    <param name="ParentCustomHint" value="-1">
    <param name="jpegBase64Data" value="">
    <param name="bmpBase64Data" value="">
    <param name="key1" value="">
    <param name="key2" value="">   
  </object>

    </td>
  </tr>
  
</table>

--%>


	<table width="99%" border="0">
				<tr>
					<td style="text-align: center;width:95%">
					
					<input type="button"  class="input-submit" onclick="submitUser();" value="保存学生资料" />
					</td>
					
				</tr>
				</table>
			
				<br>
				
		<script type="text/javascript">
		
		
			
			
			
			
			function checkValue(){
				
				
			
				if($.trim($('#userVO\\.userName').val())==''){
					alert('姓名不能为空!');
					return false;
				}
				if($.trim($('#userVO\\.age').val())==''){
					alert('年龄不能为空!');
					return false;
				}
				
				if($.trim($('#userVO\\.sfz').val())==''){
					alert('身份证号不能为空!');
					return false;
				}
				
				if($.trim($('#userVO\\.jg').val())==''){
					alert('籍贯不能为空!');
					return false;
				}
				
				if($.trim($('#userVO\\.mz').val())==''){
					alert('民族不能为空!');
					return false;
				}
				
				if(!$.trim($("#userVO\\.birthday").val())==""&&$.trim($("#userVO\\.birthday").val())=="点击选择日期"){
					alert("请选择出生年月！");
					return ;
				}
				
				
				if($.trim($('#userVO\\.hj_xian').val())==''){
					alert('户口所在县\(市\)不能为空!');
					return false;
				}
				if($.trim($('#userVO\\.hj_xiang').val())==''){
					alert('户口所在乡\(镇\)不能为空!');
					return false;
				}
				if($.trim($('#userVO\\.hj_cun').val())==''){
					alert('户口所在村不能为空!');
					return false;
				}
				
				if($.trim($('#userVO\\.hj_zu').val())==''){
					alert('户口所在组不能为空!');
					return false;
				}
				
				if(!$.trim($("#userVO\\.rxsj").val())==""&&$.trim($("#userVO\\.rxsj").val())=="点击选择日期"){
					alert("请选择入学时间！");
					return ;
				}
				
				
			
				
				if($.trim($('#userVO\\.bj').val())==''){
					alert('班级不能为空!');
					return false;
				}
				
				
				
				 jlindex=0;
				
				$('#jlTable :input').each(function(){
					
					if($.trim(this.value)==""){
						alert("个人简历部分必须填写完整");
						jlindex++;
						return false;
					}
					
				}); 
				
				if(jlindex>0){
					return false;
				}
				
				jtindex=0;
				$('#jtTable :input').each(function(){
					if($.trim(this.value)==""){
						alert("家庭成员部分必须填写完整");
						jtindex++;
						return false;
					}
				});
				if(jtindex>0){
					return false;
				}
				

				
				if(!confirm("确认提交?")){
					return;
				}
				
				$("form").submit(); 
			}
		
			
			function submitUser(){
				if(checkValue()){
					if(!confirm("确认提交?")){
						return;
					}
					
					
					$('#callMethod').val('submitUser');
					$("form").submit();
				}
				
				
			}
			
			function addJl(){

				ajaxAnywhere.submitAJAX("addJl", "jlZone");
			}
			
			function addJt(){

				ajaxAnywhere.submitAJAX("addJt", "jtZone");
			}
			
			function deleteJl(jlid){
				$("#jlId").val(jlid);	
				ajaxAnywhere.submitAJAX("deleteJl", "jlZone");
			}
			
			function deleteJt(jtid){
				$("#jtId").val(jtid);	
				ajaxAnywhere.submitAJAX("deleteJt", "jtZone");
			}
			
			$(document).ready(function(){
				$('#userVO\\.birthday').simpleDatepicker({startdate:1950 , enddate:2020 , x:175 , y:0 });
				$('#userVO\\.rxsj').simpleDatepicker({startdate:2008 , enddate:2015 , x:175 , y:0 });
			}); 
			
			function viewImage(i){
				if(i==1){
					$('#zp_img').attr("src","http://localhost:880/tx/"+$("#userVO\\.sfz").val()+"t.bmp");
					$('#zp_img').attr("width","132");
					$('#zp_img').attr("height","200");
					$('#userVO.zp').val($("#userVO\\.sfz").val()+"t.bmp");
					
				}
				
				if(i==2){
					$('#sfz_z_img').attr("src","http://localhost:880/tx/"+$("#userVO\\.sfz").val()+"z.jpg");
					$('#sfz_z_img').attr("width","360");
					$('#sfz_z_img').attr("height","200");
					$('#userVO\\.sfz_z').val($("#userVO\\.sfz").val()+"z.jpg");
				}
				if(i==3){
					$('#sfz_f_img').attr("src","http://localhost:880/tx/"+$("#userVO\\.sfz").val()+"f.jpg");
					$('#sfz_f_img').attr("width","360");
					$('#sfz_f_img').attr("height","200");
					$('#userVO\\.sfz_f').val($("#userVO\\.sfz").val()+"f.jpg");
				}
				if(i==4){
					$('#zw_img').attr("src","http://localhost:880/tx/"+$("#userVO\\.sfz").val()+"z.bmp");
					$('#zw_img').attr("width","100");
					$('#zw_img').attr("height","100");
					$('#userVO.zw').val($("#userVO\\.sfz").val()+"z.bmp");
				}
			}
			
		</script>
		
	
	</html:form>
	

</body>
</html>